package com.diandian.backend.store.param;

import com.diandian.backend.store.dto.StoreJingdongHomeStoreInfoDetailParamDTO;
import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;

public class JingdongHomeStoreDetailOpenApiParam implements Serializable {

	private String offlineCode;
	private String onlineCode;
	private String belong;
	private String orgId;
	private String orgCode;

	public void check(){
		if((this.offlineCode == null || "".equals(this.offlineCode)) && (this.onlineCode == null || "".equals(this.onlineCode))){
			throw new DefaultException("门店编码不能为空");
		}
		if(this.belong == null || "".equals(this.belong)){
			throw new DefaultException("归属标识不能为空");
		}
	}

	public StoreJingdongHomeStoreInfoDetailParamDTO toDTO(){
		StoreJingdongHomeStoreInfoDetailParamDTO result = new StoreJingdongHomeStoreInfoDetailParamDTO();
		result.setOnlineCode(this.onlineCode);
		result.setOfflineCode(this.offlineCode);
		result.setBelong(this.belong);
		result.setOrgId(this.orgId);
		result.setOrgCode(this.orgCode);
		return result;
	}

	public String getOfflineCode() {
		return offlineCode;
	}

	public void setOfflineCode(String offlineCode) {
		this.offlineCode = offlineCode;
	}

	public String getOnlineCode() {
		return onlineCode;
	}

	public void setOnlineCode(String onlineCode) {
		this.onlineCode = onlineCode;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
}
